import { post } from '@/api/request'

/** 首页获取个人检测记录列表 */
export const requestGetUserDetectionInfoList = (data: GetUserDetectionInfoListTypes.IRequest) =>
  post<GetUserDetectionInfoListTypes.IRequest, IBaseResponse<GetUserDetectionInfoListTypes.IResponse[]>>(
    '/business/tracecode/detectionInfo/getUserDetectionInfoList',
    data,
  )

/** 小程序扫码 */
export const requestScan = (data: ScanTypes.IRequest) =>
  post<ScanTypes.IRequest, IBaseResponse<ScanTypes.IResponse>>('/business/tracecode/detectionInfo/scan', data)
/** 产品溯源扫码 */
export const requestProductScan = (data: ScanTypes.IRequest) =>
  post<ScanTypes.IRequest, IBaseResponse<ScanTypes.IResponse>>('/business/tracecode/detectionInfo/productTraceabilityScan', data)

/** 修改检测信息接口 用于进行下一步操作 */
export const requestUpdateDetectionInfo = (data: UpdateDetectionInfoTypes.IRequest) =>
  post<UpdateDetectionInfoTypes.IRequest, IBaseResponse<UpdateDetectionInfoTypes.IResponse>>('/business/tracecode/detectionInfo/updateDetectionInfo', data)

/** 码绑定 */
export const requestBindCode = (data: BindCodeTypes.IRequest) =>
  post<BindCodeTypes.IRequest, IBaseResponse<BindCodeTypes.IResponse>>('/business/tracecode/detectionInfo/bindCode', data)

/** 用户交卷-新 */
export const requestSaveAnswer = (data: SaveAnswerTypes.IRequest) =>
  post<SaveAnswerTypes.IRequest, IBaseResponse<SaveAnswerTypes.IResponse>>('/business/tracecode/detectionInfo/saveAnswer', data)
